package com.tgjorgoski.utils;

import java.awt.*;

import javax.swing.border.LineBorder;
import javax.swing.plaf.basic.BasicGraphicsUtils;

public class DashedBorder extends LineBorder {
	public DashedBorder(Color color) {
		super(color);
	}

	public DashedBorder(Color color, int thickness) {
		super(color, thickness);
	}

	public void paintBorder(Component c, Graphics g, int x, int y, int width,
			int height) {
		Color oldColor = g.getColor();
		int i;

		g.setColor(lineColor);
		for (i = 0; i < thickness; i++) {
			BasicGraphicsUtils.drawDashedRect(g, x + i, y + i, width - i - i,
					height - i - i);
		}
		g.setColor(oldColor);
	}
}